package com.app.controller;


import com.app.entity.Category;
import com.app.service.CategoryService;
import com.app.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lkg
 * @since 2021-04-14
 */
@RestController
@RequestMapping("/category")
public class CategoryController {
    @Autowired
    private CategoryService categoryService;

    /**
     * 得到商品目录
     * @return
     */
    @RequestMapping("/getList")
    public Result getList(){
        return categoryService.getList();
    }

    /**
     * 保存目录
     * @return
     */
    @RequestMapping("/updateCatalogByAdmin")
    public Result updateCatalogByAdmin(@RequestBody Category category){
        return categoryService.updateCatalogByAdmin(category);
    }
}

